Visual Basic (Declaration) | |
---|---|
Public Function New( _ ByVal comparer As IEqualityComparer(Of TKey), _ ByVal locking As ILockStrategy _ ) |
C# | |
---|---|
public SynchronizedDictionary<TKey,TValue>( IEqualityComparer<TKey> comparer, ILockStrategy locking ) |
Parameters
- comparer
- locking
Library/Library.Test/TestSynchronizedCollections.cs
C# | Copy Code |
---|---|
SynchronizedDictionary<string, string> test = new SynchronizedDictionary<string, string>(StringComparer.Ordinal, new IgnoreLocking()); test["a"] = "b"; Assert.AreEqual(1, test.Count); test.ReplaceStorage(new Dictionary<string, string>()); Assert.AreEqual(0, test.Count); |
VB.NET | Copy Code |
---|---|
Dim test As New SynchronizedDictionary(Of String, String)(StringComparer.Ordinal, New IgnoreLocking()) test("a") = "b" Assert.AreEqual(1, test.Count) test.ReplaceStorage(New Dictionary(Of String, String)()) Assert.AreEqual(0, test.Count) |
Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7